home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks '96 / Audio dcmds / Audio CD dcmds.sit / Audio CD dcmds.π / play dcmd / dcmd.c < prev    next >
MacBinary  |  1995-07-06  |  7.1 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
10% dexvert Jesper Olsen Module (music/jesperOlsen) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Thu Jul 6 13:34:18 1995, modified Thu Jul 6 13:34:18 1995, creator Think C, type ASCII, 6604 bytes "dcmd.c" , at 0x1a4c 410 bytes resource default (weak)
99% file data default
49% TrID Macintosh plain text (MacBinary) default
33% TrID TTComp archive compressed (bin-4K) default (weak)
16% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 06 64 63 6d 64 2e 63 | 00 00 00 00 00 00 00 00 |..dcmd.c|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 19 cc 00 | 00 01 9a ac 21 cf 1a ac |........|....!...|
|00000060| 21 cf 1a 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |!.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 0f 8b 00 00 |........|........|
|00000080| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|00000090| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000b0| 2a 2a 2a 2a 2a 2a 0d 0d | 09 62 69 6e 2e 63 09 09 |******..|.bin.c..|
|000000c0| 09 09 09 50 2e 20 53 74 | 61 64 65 6c 6d 61 6e 6e |...P. St|adelmann|
|000000d0| 2c 20 4a 75 6e 65 20 31 | 39 39 34 0d 09 0d 09 44 |, June 1|994....D|
|000000e0| 69 73 70 6c 61 79 73 20 | 61 20 6c 6f 6e 67 20 77 |isplays |a long w|
|000000f0| 6f 72 64 20 69 6e 20 62 | 69 6e 61 72 79 2e 0d 0d |ord in b|inary...|
|00000100| 20 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a | *******|********|
|00000110| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000120| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000130| 2a 2a 2a 2a 2a 2a 2f 0d | 0d 0d 23 69 6e 63 6c 75 |******/.|..#inclu|
|00000140| 64 65 20 3c 53 65 74 55 | 70 41 34 2e 68 3e 09 2f |de <SetU|pA4.h>./|
|00000150| 2f 64 63 6d 64 2e 68 0d | 23 69 6e 63 6c 75 64 65 |/dcmd.h.|#include|
|00000160| 20 3c 54 68 69 6e 6b 5f | 64 63 6d 64 2e 68 3e 0d | <Think_|dcmd.h>.|
|00000170| 23 69 6e 63 6c 75 64 65 | 20 3c 54 68 69 6e 6b 5f |#include| <Think_|
|00000180| 70 75 74 2e 68 3e 0d 23 | 69 6e 63 6c 75 64 65 20 |put.h>.#|include |
|00000190| 22 63 64 2e 68 22 0d 23 | 69 6e 63 6c 75 64 65 20 |"cd.h".#|include |
|000001a0| 22 74 6f 6f 6c 75 74 69 | 6c 73 2e 68 22 0d 23 64 |"tooluti|ls.h".#d|
|000001b0| 65 66 69 6e 65 20 6d 69 | 6e 28 78 2c 79 29 20 28 |efine mi|n(x,y) (|
|000001c0| 78 20 3c 20 79 20 3f 20 | 78 20 3a 20 79 20 29 0d |x < y ? |x : y ).|
|000001d0| 23 64 65 66 69 6e 65 20 | 6d 61 78 28 78 2c 79 29 |#define |max(x,y)|
|000001e0| 20 28 78 20 3e 20 79 20 | 3f 20 78 20 3a 20 79 20 | (x > y |? x : y |
|000001f0| 29 0d 0d 76 6f 69 64 09 | 50 6c 61 79 54 72 61 63 |)..void.|PlayTrac|
|00000200| 6b 28 42 79 74 65 20 73 | 74 61 72 74 54 72 61 63 |k(Byte s|tartTrac|
|00000210| 6b 29 3b 0d 70 61 73 63 | 61 6c 20 42 6f 6f 6c 65 |k);.pasc|al Boole|
|00000220| 61 6e 09 42 69 74 54 65 | 73 74 28 63 6f 6e 73 74 |an.BitTe|st(const|
|00000230| 20 76 6f 69 64 20 2a 09 | 64 61 74 61 2c 20 6c 6f | void *.|data, lo|
|00000240| 6e 67 20 62 69 74 4e 75 | 6d 29 3b 0d 76 6f 69 64 |ng bitNu|m);.void|
|00000250| 20 09 44 6f 41 75 64 69 | 6f 43 6f 6d 6d 61 6e 64 | .DoAudi|oCommand|
|00000260| 28 73 68 6f 72 74 20 63 | 6f 6d 6d 61 6e 64 29 3b |(short c|ommand);|
|00000270| 0d 0d 76 6f 69 64 20 44 | 6f 48 65 6c 70 28 20 76 |..void D|oHelp( v|
|00000280| 6f 69 64 20 29 0d 7b 0d | 09 50 75 74 50 53 74 72 |oid ).{.|.PutPStr|
|00000290| 28 20 22 5c 70 70 6c 61 | 79 20 5b 54 72 61 63 6b |( "\ppla|y [Track|
|000002a0| 20 23 20 7c 20 50 20 7c | 20 45 20 7c 20 53 20 7c | # | P || E | S ||
|000002b0| 20 3f 20 7c 20 2b 20 7c | 20 2d 20 5d 22 29 3b 0d | ? | + || - ]");.|
|000002c0| 09 50 75 74 4c 69 6e 65 | 28 29 3b 0d 09 50 75 74 |.PutLine|();..Put|
|000002d0| 50 53 74 72 28 20 22 5c | 70 20 20 20 53 74 61 72 |PStr( "\|p Star|
|000002e0| 74 73 20 70 6c 61 79 69 | 6e 67 20 61 6e 20 61 75 |ts playi|ng an au|
|000002f0| 64 69 6f 20 43 44 2e 20 | 22 29 3b 0d 09 50 75 74 |dio CD. |");..Put|
|00000300| 4c 69 6e 65 28 29 3b 0d | 09 50 75 74 50 53 74 72 |Line();.|.PutPStr|
|00000310| 28 20 22 5c 70 20 20 20 | 54 72 61 63 6b 20 23 20 |( "\p |Track # |
|00000320| 2d 20 53 74 61 72 74 20 | 70 6c 61 79 69 6e 67 20 |- Start |playing |
|00000330| 66 72 6f 6d 20 74 68 65 | 20 70 72 6f 76 69 64 65 |from the| provide|
|00000340| 64 20 74 72 61 63 6b 20 | 6e 75 6d 62 65 72 22 29 |d track |number")|
|00000350| 3b 0d 09 50 75 74 4c 69 | 6e 65 28 29 3b 0d 09 50 |;..PutLi|ne();..P|
|00000360| 75 74 50 53 74 72 28 20 | 22 5c 70 20 20 20 50 20 |utPStr( |"\p P |
|00000370| 2d 20 50 61 75 73 65 20 | 6f 72 20 72 65 73 75 6d |- Pause |or resum|
|00000380| 65 20 70 6c 61 79 22 29 | 3b 0d 09 50 75 74 4c 69 |e play")|;..PutLi|
|00000390| 6e 65 28 29 3b 0d 09 50 | 75 74 50 53 74 72 28 20 |ne();..P|utPStr( |
|000003a0| 22 5c 70 20 20 20 45 20 | 2d 20 45 6a 65 63 74 20 |"\p E |- Eject |
|000003b0| 74 68 65 20 64 69 73 6b | 22 29 3b 0d 09 50 75 74 |the disk|");..Put|
|000003c0| 4c 69 6e 65 28 29 3b 0d | 09 50 75 74 50 53 74 72 |Line();.|.PutPStr|
|000003d0| 28 20 22 5c 70 20 20 20 | 53 20 2d 20 53 74 6f 70 |( "\p |S - Stop|
|000003e0| 20 70 6c 61 79 69 6e 67 | 22 29 3b 0d 09 50 75 74 | playing|");..Put|
|000003f0| 4c 69 6e 65 28 29 3b 0d | 09 50 75 74 50 53 74 72 |Line();.|.PutPStr|
|00000400| 28 20 22 5c 70 20 20 20 | 3f 20 2d 20 53 68 6f 77 |( "\p |? - Show|
|00000410| 20 63 75 72 72 65 6e 74 | 20 74 72 61 63 6b 20 61 | current| track a|
|00000420| 6e 64 20 74 69 6d 65 20 | 69 6e 66 6f 22 29 3b 0d |nd time |info");.|
|00000430| 09 50 75 74 4c 69 6e 65 | 28 29 3b 0d 09 50 75 74 |.PutLine|();..Put|
|00000440| 50 53 74 72 28 20 22 5c | 70 20 20 20 2b 20 2d 20 |PStr( "\|p + - |
|00000450| 53 6b 69 70 20 74 6f 20 | 74 68 65 20 6e 65 78 74 |Skip to |the next|
|00000460| 20 74 72 61 63 6b 22 29 | 3b 0d 09 50 75 74 4c 69 | track")|;..PutLi|
|00000470| 6e 65 28 29 3b 0d 09 50 | 75 74 50 53 74 72 28 20 |ne();..P|utPStr( |
|00000480| 22 5c 70 20 20 20 2d 20 | 2d 20 53 6b 69 70 20 74 |"\p - |- Skip t|
|00000490| 6f 20 74 68 65 20 70 72 | 65 76 69 6f 75 73 20 74 |o the pr|evious t|
|000004a0| 72 61 63 6b 22 29 3b 0d | 09 50 75 74 4c 69 6e 65 |rack");.|.PutLine|
|000004b0| 28 29 3b 0d 7d 0d 0d 76 | 6f 69 64 20 44 6f 4a 6f |();.}..v|oid DoJo|
|000004c0| 62 28 29 0d 7b 0d 09 09 | 6c 6f 6e 67 09 09 76 61 |b().{...|long..va|
|000004d0| 6c 75 65 3b 0d 09 09 42 | 6f 6f 6c 65 61 6e 09 09 |lue;...B|oolean..|
|000004e0| 6f 6b 3b 0d 09 09 53 74 | 72 32 35 35 09 09 6d 79 |ok;...St|r255..my|
|000004f0| 53 74 72 3b 0d 09 09 73 | 68 6f 72 74 09 09 70 6f |Str;...s|hort..po|
|00000500| 73 3b 0d 09 0d 09 73 77 | 69 74 63 68 28 64 63 6d |s;....sw|itch(dcm|
|00000510| 64 50 65 65 6b 41 74 4e | 65 78 74 43 68 61 72 28 |dPeekAtN|extChar(|
|00000520| 29 29 20 7b 0d 09 09 63 | 61 73 65 20 27 5c 72 27 |)) {...c|ase '\r'|
|00000530| 3a 0d 09 09 09 50 6c 61 | 79 54 72 61 63 6b 28 31 |:....Pla|yTrack(1|
|00000540| 29 3b 0d 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 0d |);....br|eak;....|
|00000550| 09 09 63 61 73 65 20 27 | 50 27 3a 0d 09 09 63 61 |..case '|P':...ca|
|00000560| 73 65 20 27 45 27 3a 0d | 09 09 63 61 73 65 20 27 |se 'E':.|..case '|
|00000570| 53 27 3a 09 09 0d 09 09 | 63 61 73 65 20 27 70 27 |S':.....|case 'p'|
|00000580| 3a 0d 09 09 63 61 73 65 | 20 27 65 27 3a 0d 09 09 |:...case| 'e':...|
|00000590| 63 61 73 65 20 27 73 27 | 3a 09 09 0d 09 09 63 61 |case 's'|:.....ca|
|000005a0| 73 65 20 27 3f 27 3a 0d | 09 09 63 61 73 65 20 27 |se '?':.|..case '|
|000005b0| 2b 27 3a 0d 09 09 63 61 | 73 65 20 27 2d 27 3a 0d |+':...ca|se '-':.|
|000005c0| 09 09 09 70 6f 73 20 3d | 20 64 63 6d 64 47 65 74 |...pos =| dcmdGet|
|000005d0| 50 6f 73 69 74 69 6f 6e | 28 29 3b 0d 09 09 09 64 |Position|();....d|
|000005e0| 63 6d 64 47 65 74 4e 65 | 78 74 45 78 70 72 65 73 |cmdGetNe|xtExpres|
|000005f0| 73 69 6f 6e 28 20 26 76 | 61 6c 75 65 2c 20 26 6f |sion( &v|alue, &o|
|00000600| 6b 20 29 3b 0d 09 09 09 | 44 6f 41 75 64 69 6f 43 |k );....|DoAudioC|
|00000610| 6f 6d 6d 61 6e 64 28 64 | 63 6d 64 50 65 65 6b 41 |ommand(d|cmdPeekA|
|00000620| 74 4e 65 78 74 43 68 61 | 72 28 29 29 3b 0d 09 09 |tNextCha|r());...|
|00000630| 09 62 72 65 61 6b 3b 0d | 09 09 09 0d 09 09 63 61 |.break;.|......ca|
|00000640| 73 65 20 27 56 27 3a 0d | 09 09 63 61 73 65 20 27 |se 'V':.|..case '|
|00000650| 76 27 3a 0d 09 09 09 64 | 63 6d 64 47 65 74 4e 65 |v':....d|cmdGetNe|
|00000660| 78 74 50 61 72 61 6d 65 | 74 65 72 28 6d 79 53 74 |xtParame|ter(mySt|
|00000670| 72 29 3b 0d 09 09 09 70 | 6f 73 20 3d 20 64 63 6d |r);....p|os = dcm|
|00000680| 64 47 65 74 50 6f 73 69 | 74 69 6f 6e 28 29 3b 0d |dGetPosi|tion();.|
|00000690| 09 09 09 64 63 6d 64 53 | 65 74 50 6f 73 69 74 69 |...dcmdS|etPositi|
|000006a0| 6f 6e 28 70 6f 73 29 3b | 0d 09 09 09 64 63 6d 64 |on(pos);|....dcmd|
|000006b0| 47 65 74 4e 65 78 74 45 | 78 70 72 65 73 73 69 6f |GetNextE|xpressio|
|000006c0| 6e 28 20 26 76 61 6c 75 | 65 2c 20 26 6f 6b 20 29 |n( &valu|e, &ok )|
|000006d0| 3b 0d 09 09 09 69 66 28 | 6f 6b 20 26 26 20 76 61 |;....if(|ok && va|
|000006e0| 6c 75 65 20 3e 3d 20 30 | 20 26 26 20 76 61 6c 75 |lue >= 0| && valu|
|000006f0| 65 20 3c 3d 20 32 35 35 | 29 20 7b 0d 09 09 09 09 |e <= 255|) {.....|
|00000700| 4f 53 45 72 72 09 6f 73 | 45 72 72 3b 0d 09 09 09 |OSErr.os|Err;....|
|00000710| 09 73 68 6f 72 74 20 69 | 6f 52 65 66 4e 75 6d 3b |.short i|oRefNum;|
|00000720| 0d 09 09 09 09 6f 73 45 | 72 72 20 3d 20 4f 70 65 |.....osE|rr = Ope|
|00000730| 6e 43 44 28 31 2c 20 26 | 69 6f 52 65 66 4e 75 6d |nCD(1, &|ioRefNum|
|00000740| 29 3b 0d 09 09 09 09 0d | 09 09 09 09 69 66 28 6f |);......|....if(o|
|00000750| 73 45 72 72 20 21 3d 20 | 6e 6f 45 72 72 29 20 7b |sErr != |noErr) {|
|00000760| 0d 09 09 09 09 09 50 75 | 74 4c 69 6e 65 28 29 3b |......Pu|tLine();|
|00000770| 0d 09 09 09 09 09 50 75 | 74 50 53 74 72 28 20 22 |......Pu|tPStr( "|
|00000780| 5c 70 43 6f 75 6c 64 6e | 27 74 20 6f 70 65 6e 20 |\pCouldn|'t open |
|00000790| 43 44 20 44 72 69 76 65 | 21 22 29 3b 0d 09 09 09 |CD Drive|!");....|
|000007a0| 09 09 72 65 74 75 72 6e | 3b 0d 09 09 09 09 7d 0d |..return|;.....}.|
|000007b0| 09 09 09 09 69 66 28 21 | 44 69 73 63 49 6e 44 72 |....if(!|DiscInDr|
|000007c0| 69 76 65 28 69 6f 52 65 | 66 4e 75 6d 29 29 20 7b |ive(ioRe|fNum)) {|
|000007d0| 0d 09 09 09 09 09 50 75 | 74 4c 69 6e 65 28 29 3b |......Pu|tLine();|
|000007e0| 0d 09 09 09 09 09 50 75 | 74 50 53 74 72 28 20 22 |......Pu|tPStr( "|
|000007f0| 5c 70 4e 6f 20 64 69 73 | 6b 20 69 6e 20 43 44 20 |\pNo dis|k in CD |
|00000800| 44 72 69 76 65 21 22 29 | 3b 0d 09 09 09 09 09 72 |Drive!")|;......r|
|00000810| 65 74 75 72 6e 3b 0d 09 | 09 09 09 7d 0d 0d 09 09 |eturn;..|...}....|
|00000820| 09 09 50 75 74 50 53 74 | 72 28 20 22 5c 70 53 65 |..PutPSt|r( "\pSe|
|00000830| 74 74 69 6e 67 20 76 6f | 6c 75 6d 65 20 74 6f 20 |tting vo|lume to |
|00000840| 22 29 3b 0d 09 09 09 09 | 50 75 74 53 44 65 63 28 |");.....|PutSDec(|
|00000850| 76 61 6c 75 65 29 3b 0d | 09 09 09 09 41 53 65 74 |value);.|....ASet|
|00000860| 56 6f 6c 75 6d 65 28 69 | 6f 52 65 66 4e 75 6d 2c |Volume(i|oRefNum,|
|00000870| 20 76 61 6c 75 65 29 3b | 0d 09 09 09 7d 0d 09 09 | value);|....}...|
|00000880| 09 65 6c 73 65 20 7b 0d | 09 09 09 09 50 75 74 50 |.else {.|....PutP|
|00000890| 53 74 72 28 20 22 5c 70 | 56 6f 6c 75 6d 65 20 6e |Str( "\p|Volume n|
|000008a0| 6f 74 20 66 6f 75 6e 64 | 20 6f 72 20 6f 75 74 20 |ot found| or out |
|000008b0| 6f 66 20 72 61 6e 67 65 | 22 29 3b 0d 09 09 09 7d |of range|");....}|
|000008c0| 0d 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 0d 09 |....brea|k;......|
|000008d0| 09 64 65 66 61 75 6c 74 | 3a 0d 09 09 09 7b 0d 09 |.default|:....{..|
|000008e0| 09 09 09 70 6f 73 20 3d | 20 64 63 6d 64 47 65 74 |...pos =| dcmdGet|
|000008f0| 50 6f 73 69 74 69 6f 6e | 28 29 3b 0d 09 09 09 09 |Position|();.....|
|00000900| 64 63 6d 64 47 65 74 4e | 65 78 74 45 78 70 72 65 |dcmdGetN|extExpre|
|00000910| 73 73 69 6f 6e 28 20 26 | 76 61 6c 75 65 2c 20 26 |ssion( &|value, &|
|00000920| 6f 6b 20 29 3b 0d 09 09 | 0d 09 09 09 09 69 66 20 |ok );...|.....if |
|00000930| 28 6f 6b 29 0d 09 09 09 | 09 7b 0d 09 09 09 09 09 |(ok)....|.{......|
|00000940| 50 75 74 50 53 74 72 28 | 20 22 5c 70 73 74 61 72 |PutPStr(| "\pstar|
|00000950| 74 69 6e 67 20 61 74 20 | 74 72 61 63 6b 20 22 29 |ting at |track ")|
|00000960| 3b 0d 09 09 09 09 09 50 | 75 74 53 44 65 63 28 76 |;......P|utSDec(v|
|00000970| 61 6c 75 65 29 3b 0d 09 | 09 09 09 09 50 75 74 50 |alue);..|....PutP|
|00000980| 53 74 72 28 22 5c 70 c9 | 22 29 3b 0d 09 09 09 09 |Str("\p.|");.....|
|00000990| 09 50 6c 61 79 54 72 61 | 63 6b 28 76 61 6c 75 65 |.PlayTra|ck(value|
|000009a0| 29 3b 09 09 0d 09 09 09 | 09 7d 0d 09 09 09 09 65 |);......|.}.....e|
|000009b0| 6c 73 65 0d 09 09 09 09 | 09 50 75 74 50 53 74 72 |lse.....|.PutPStr|
|000009c0| 28 20 22 5c 70 53 79 6e | 74 61 78 20 65 72 72 6f |( "\pSyn|tax erro|
|000009d0| 72 22 29 3b 0d 09 09 09 | 7d 0d 09 09 09 62 72 65 |r");....|}....bre|
|000009e0| 61 6b 3b 0d 09 7d 0d 0d | 09 50 75 74 4c 69 6e 65 |ak;..}..|.PutLine|
|000009f0| 28 29 3b 0d 0d 7d 0d 0d | 76 6f 69 64 20 53 65 74 |();..}..|void Set|
|00000a00| 56 6f 6c 75 6d 65 28 73 | 68 6f 72 74 20 76 61 6c |Volume(s|hort val|
|00000a10| 75 65 29 0d 7b 0d 0d 7d | 0d 0d 76 6f 69 64 20 09 |ue).{..}|..void .|
|00000a20| 44 6f 41 75 64 69 6f 43 | 6f 6d 6d 61 6e 64 28 73 |DoAudioC|ommand(s|
|00000a30| 68 6f 72 74 20 63 6f 6d | 6d 61 6e 64 29 0d 7b 0d |hort com|mand).{.|
|00000a40| 09 4f 53 45 72 72 09 6f | 73 45 72 72 3b 0d 09 73 |.OSErr.o|sErr;..s|
|00000a50| 68 6f 72 74 09 64 72 69 | 76 65 2c 0d 09 09 09 69 |hort.dri|ve,....i|
|00000a60| 6f 52 65 66 4e 75 6d 2c | 0d 09 09 09 63 6f 75 6e |oRefNum,|....coun|
|00000a70| 74 2c 0d 09 09 09 74 72 | 61 63 6b 2c 0d 09 09 09 |t,....tr|ack,....|
|00000a80| 73 74 61 74 65 3b 0d 09 | 42 79 74 65 09 75 73 65 |state;..|Byte.use|
|00000a90| 72 43 44 4e 75 6d 62 65 | 72 2c 0d 09 09 09 75 73 |rCDNumbe|r,....us|
|00000aa0| 65 72 53 74 61 72 74 2c | 20 0d 09 09 09 75 73 65 |erStart,| ....use|
|00000ab0| 72 53 74 6f 70 2c 0d 09 | 09 09 64 69 73 63 53 74 |rStop,..|..discSt|
|00000ac0| 61 72 74 2c 0d 09 09 09 | 64 69 73 63 53 74 6f 70 |art,....|discStop|
|00000ad0| 2c 0d 09 09 09 61 75 64 | 69 6f 53 74 61 74 75 73 |,....aud|ioStatus|
|00000ae0| 2c 0d 09 09 09 70 6c 61 | 79 4d 6f 64 65 2c 0d 09 |,....pla|yMode,..|
|00000af0| 09 09 63 6e 74 6c 46 69 | 65 6c 64 2c 0d 09 09 09 |..cntlFi|eld,....|
|00000b00| 6d 69 6e 75 74 65 73 2c | 0d 09 09 09 73 65 63 6f |minutes,|....seco|
|00000b10| 6e 64 73 2c 0d 09 09 09 | 66 72 61 6d 65 73 3b 0d |nds,....|frames;.|
|00000b20| 09 42 79 74 65 09 09 74 | 72 61 63 6b 4d 69 6e 2c |.Byte..t|rackMin,|
|00000b30| 20 74 72 61 63 6b 53 65 | 63 2c 20 74 72 61 63 6b | trackSe|c, track|
|00000b40| 46 72 61 6d 65 3b 0d 09 | 42 79 74 65 09 63 75 72 |Frame;..|Byte.cur|
|00000b50| 72 65 6e 74 54 72 61 63 | 6b 2c 20 64 69 73 63 4d |rentTrac|k, discM|
|00000b60| 69 6e 2c 20 64 69 73 63 | 53 65 63 2c 20 64 69 73 |in, disc|Sec, dis|
|00000b70| 63 46 72 61 6d 65 3b 0d | 0d 0d 09 75 73 65 72 43 |cFrame;.|...userC|
|00000b80| 44 4e 75 6d 62 65 72 09 | 3d 20 31 3b 0d 09 75 73 |DNumber.|= 1;..us|
|00000b90| 65 72 53 74 61 72 74 09 | 09 3d 20 30 3b 0d 09 75 |erStart.|.= 0;..u|
|00000ba0| 73 65 72 53 74 6f 70 09 | 09 3d 20 31 30 30 3b 0d |serStop.|.= 100;.|
|00000bb0| 09 70 6c 61 79 4d 6f 64 | 65 09 09 3d 20 53 54 45 |.playMod|e..= STE|
|00000bc0| 52 45 4f 3b 0d 0d 09 6f | 73 45 72 72 20 3d 20 4f |REO;...o|sErr = O|
|00000bd0| 70 65 6e 43 44 28 75 73 | 65 72 43 44 4e 75 6d 62 |penCD(us|erCDNumb|
|00000be0| 65 72 2c 20 26 69 6f 52 | 65 66 4e 75 6d 29 3b 0d |er, &ioR|efNum);.|
|00000bf0| 09 69 66 28 6f 73 45 72 | 72 20 21 3d 20 6e 6f 45 |.if(osEr|r != noE|
|00000c00| 72 72 29 20 7b 0d 09 09 | 50 75 74 4c 69 6e 65 28 |rr) {...|PutLine(|
|00000c10| 29 3b 0d 09 09 50 75 74 | 50 53 74 72 28 20 22 5c |);...Put|PStr( "\|
|00000c20| 70 43 6f 75 6c 64 6e 27 | 74 20 6f 70 65 6e 20 43 |pCouldn'|t open C|
|00000c30| 44 20 44 72 69 76 65 21 | 22 29 3b 0d 09 09 72 65 |D Drive!|");...re|
|00000c40| 74 75 72 6e 3b 0d 09 7d | 0d 09 69 66 28 21 44 69 |turn;..}|..if(!Di|
|00000c50| 73 63 49 6e 44 72 69 76 | 65 28 69 6f 52 65 66 4e |scInDriv|e(ioRefN|
|00000c60| 75 6d 29 29 20 7b 0d 09 | 09 50 75 74 4c 69 6e 65 |um)) {..|.PutLine|
|00000c70| 28 29 3b 0d 09 09 50 75 | 74 50 53 74 72 28 20 22 |();...Pu|tPStr( "|
|00000c80| 5c 70 4e 6f 20 64 69 73 | 6b 20 69 6e 20 43 44 20 |\pNo dis|k in CD |
|00000c90| 44 72 69 76 65 21 22 29 | 3b 0d 09 09 72 65 74 75 |Drive!")|;...retu|
|00000ca0| 72 6e 3b 0d 09 7d 0d 20 | 09 0d 09 6f 73 45 72 72 |rn;..}. |...osErr|
|00000cb0| 20 3d 20 41 53 74 61 74 | 75 73 28 69 6f 52 65 66 | = AStat|us(ioRef|
|00000cc0| 4e 75 6d 2c 20 26 61 75 | 64 69 6f 53 74 61 74 75 |Num, &au|dioStatu|
|00000cd0| 73 2c 20 26 70 6c 61 79 | 4d 6f 64 65 2c 20 26 63 |s, &play|Mode, &c|
|00000ce0| 6e 74 6c 46 69 65 6c 64 | 2c 20 26 6d 69 6e 75 74 |ntlField|, &minut|
|00000cf0| 65 73 2c 20 26 73 65 63 | 6f 6e 64 73 2c 20 26 66 |es, &sec|onds, &f|
|00000d00| 72 61 6d 65 73 29 3b 0d | 09 0d 09 64 69 73 63 53 |rames);.|...discS|
|00000d10| 74 61 72 74 20 3d 20 30 | 3b 20 0d 09 64 6f 20 0d |tart = 0|; ..do .|
|00000d20| 09 09 6f 73 45 72 72 20 | 3d 20 54 72 61 63 6b 49 |..osErr |= TrackI|
|00000d30| 6e 66 6f 28 69 6f 52 65 | 66 4e 75 6d 2c 20 2b 2b |nfo(ioRe|fNum, ++|
|00000d40| 64 69 73 63 53 74 61 72 | 74 2c 20 26 63 6e 74 6c |discStar|t, &cntl|
|00000d50| 46 69 65 6c 64 2c 20 26 | 6d 69 6e 75 74 65 73 2c |Field, &|minutes,|
|00000d60| 20 26 73 65 63 6f 6e 64 | 73 2c 20 26 66 72 61 6d | &second|s, &fram|
|00000d70| 65 73 29 3b 0d 09 77 68 | 69 6c 65 20 28 42 69 74 |es);..wh|ile (Bit|
|00000d80| 54 73 74 28 26 63 6e 74 | 6c 46 69 65 6c 64 2c 20 |Tst(&cnt|lField, |
|00000d90| 35 29 20 26 26 20 6e 6f | 45 72 72 20 3d 3d 20 6f |5) && no|Err == o|
|00000da0| 73 45 72 72 29 3b 20 0d | 09 6f 73 45 72 72 20 3d |sErr); .|.osErr =|
|00000db0| 20 54 72 61 63 6b 43 6f | 75 6e 74 28 69 6f 52 65 | TrackCo|unt(ioRe|
|00000dc0| 66 4e 75 6d 2c 20 26 64 | 69 73 63 53 74 6f 70 29 |fNum, &d|iscStop)|
|00000dd0| 3b 0d 09 6f 73 45 72 72 | 20 3d 20 41 43 75 72 72 |;..osErr| = ACurr|
|00000de0| 54 72 61 63 6b 49 6e 66 | 6f 28 69 6f 52 65 66 4e |TrackInf|o(ioRefN|
|00000df0| 75 6d 2c 20 26 63 75 72 | 72 65 6e 74 54 72 61 63 |um, &cur|rentTrac|
|00000e00| 6b 2c 20 26 74 72 61 63 | 6b 4d 69 6e 2c 20 26 74 |k, &trac|kMin, &t|
|00000e10| 72 61 63 6b 53 65 63 2c | 20 26 74 72 61 63 6b 46 |rackSec,| &trackF|
|00000e20| 72 61 6d 65 29 3b 0d 0d | 0d 09 73 77 69 74 63 68 |rame);..|..switch|
|00000e30| 20 28 63 6f 6d 6d 61 6e | 64 29 20 7b 0d 09 09 63 | (comman|d) {...c|
|00000e40| 61 73 65 20 27 70 27 3a | 0d 09 09 63 61 73 65 20 |ase 'p':|...case |
|00000e50| 27 50 27 3a 0d 09 09 09 | 69 66 28 61 75 64 69 6f |'P':....|if(audio|
|00000e60| 53 74 61 74 75 73 20 3d | 3d 20 50 41 55 53 45 44 |Status =|= PAUSED|
|00000e70| 29 20 7b 0d 09 09 09 09 | 50 75 74 50 53 74 72 28 |) {.....|PutPStr(|
|00000e80| 20 22 5c 70 52 65 73 75 | 6d 69 6e 67 22 29 3b 0d | "\pResu|ming");.|
|00000e90| 09 09 09 09 6f 73 45 72 | 72 20 3d 20 41 50 61 75 |....osEr|r = APau|
|00000ea0| 73 65 28 69 6f 52 65 66 | 4e 75 6d 2c 20 43 4f 4e |se(ioRef|Num, CON|
|00000eb0| 54 49 4e 55 45 29 3b 0d | 09 09 09 7d 20 65 6c 73 |TINUE);.|...} els|
|00000ec0| 65 20 7b 0d 09 09 09 09 | 69 66 28 61 75 64 69 6f |e {.....|if(audio|
|00000ed0| 53 74 61 74 75 73 20 3d | 3d 20 50 4c 41 59 49 4e |Status =|= PLAYIN|
|00000ee0| 47 29 20 7b 0d 09 09 09 | 09 09 50 75 74 50 53 74 |G) {....|..PutPSt|
|00000ef0| 72 28 20 22 5c 70 50 61 | 75 73 69 6e 67 22 29 3b |r( "\pPa|using");|
|00000f00| 0d 09 09 09 09 09 6f 73 | 45 72 72 20 3d 20 41 50 |......os|Err = AP|
|00000f10| 61 75 73 65 28 69 6f 52 | 65 66 4e 75 6d 2c 20 50 |ause(ioR|efNum, P|
|00000f20| 41 55 53 45 29 3b 0d 09 | 09 09 09 7d 0d 09 09 09 |AUSE);..|...}....|
|00000f30| 7d 0d 09 09 09 62 72 65 | 61 6b 3b 0d 09 09 09 0d |}....bre|ak;.....|
|00000f40| 09 09 63 61 73 65 20 27 | 53 27 3a 0d 09 09 63 61 |..case '|S':...ca|
|00000f50| 73 65 20 27 73 27 3a 0d | 09 09 09 50 75 74 50 53 |se 's':.|...PutPS|
|00000f60| 74 72 28 20 22 5c 70 53 | 74 6f 70 70 69 6e 67 22 |tr( "\pS|topping"|
|00000f70| 29 3b 0d 09 09 09 6f 73 | 45 72 72 20 3d 20 41 53 |);....os|Err = AS|
|00000f80| 74 6f 70 28 69 6f 52 65 | 66 4e 75 6d 2c 20 30 29 |top(ioRe|fNum, 0)|
|00000f90| 3b 0d 09 09 09 62 72 65 | 61 6b 3b 0d 09 0d 09 09 |;....bre|ak;.....|
|00000fa0| 63 61 73 65 20 27 2b 27 | 3a 0d 09 09 09 6f 73 45 |case '+'|:....osE|
|00000fb0| 72 72 20 3d 20 41 54 72 | 6b 53 65 61 72 63 68 28 |rr = ATr|kSearch(|
|00000fc0| 20 69 6f 52 65 66 4e 75 | 6d 2c 20 2b 2b 63 75 72 | ioRefNu|m, ++cur|
|00000fd0| 72 65 6e 74 54 72 61 63 | 6b 2c 20 61 75 64 69 6f |rentTrac|k, audio|
|00000fe0| 53 74 61 74 75 73 2c 20 | 70 6c 61 79 4d 6f 64 65 |Status, |playMode|
|00000ff0| 29 3b 0d 09 09 09 50 75 | 74 50 53 74 72 28 20 22 |);....Pu|tPStr( "|
|00001000| 5c 70 73 77 69 74 63 68 | 69 6e 67 20 74 6f 20 74 |\pswitch|ing to t|
|00001010| 72 61 63 6b 20 22 29 3b | 0d 09 09 09 50 75 74 53 |rack ");|....PutS|
|00001020| 44 65 63 28 63 75 72 72 | 65 6e 74 54 72 61 63 6b |Dec(curr|entTrack|
|00001030| 29 3b 0d 09 09 09 6f 73 | 45 72 72 20 3d 20 41 50 |);....os|Err = AP|
|00001040| 61 75 73 65 28 69 6f 52 | 65 66 4e 75 6d 2c 20 61 |ause(ioR|efNum, a|
|00001050| 75 64 69 6f 53 74 61 74 | 75 73 29 3b 0d 09 09 09 |udioStat|us);....|
|00001060| 62 72 65 61 6b 3b 0d 09 | 09 0d 09 09 63 61 73 65 |break;..|....case|
|00001070| 20 27 2d 27 3a 0d 09 09 | 09 69 66 28 28 74 72 61 | '-':...|.if((tra|
|00001080| 63 6b 4d 69 6e 20 3d 3d | 20 30 29 20 26 26 20 28 |ckMin ==| 0) && (|
|00001090| 74 72 61 63 6b 53 65 63 | 20 3c 3d 31 30 29 29 20 |trackSec| <=10)) |
|000010a0| 7b 0d 09 09 09 09 6f 73 | 45 72 72 20 3d 20 41 54 |{.....os|Err = AT|
|000010b0| 72 6b 53 65 61 72 63 68 | 28 20 69 6f 52 65 66 4e |rkSearch|( ioRefN|
|000010c0| 75 6d 2c 20 2d 2d 63 75 | 72 72 65 6e 74 54 72 61 |um, --cu|rrentTra|
|000010d0| 63 6b 2c 20 61 75 64 69 | 6f 53 74 61 74 75 73 2c |ck, audi|oStatus,|
|000010e0| 20 70 6c 61 79 4d 6f 64 | 65 29 3b 0d 09 09 09 7d | playMod|e);....}|
|000010f0| 0d 09 09 09 65 6c 73 65 | 20 7b 0d 09 09 09 09 6f |....else| {.....o|
|00001100| 73 45 72 72 20 3d 20 41 | 54 72 6b 53 65 61 72 63 |sErr = A|TrkSearc|
|00001110| 68 28 20 69 6f 52 65 66 | 4e 75 6d 2c 20 63 75 72 |h( ioRef|Num, cur|
|00001120| 72 65 6e 74 54 72 61 63 | 6b 2c 20 61 75 64 69 6f |rentTrac|k, audio|
|00001130| 53 74 61 74 75 73 2c 20 | 70 6c 61 79 4d 6f 64 65 |Status, |playMode|
|00001140| 29 3b 0d 09 09 09 7d 0d | 09 09 09 50 75 74 50 53 |);....}.|...PutPS|
|00001150| 74 72 28 20 22 5c 70 73 | 77 69 74 63 68 69 6e 67 |tr( "\ps|witching|
|00001160| 20 74 6f 20 74 72 61 63 | 6b 20 22 29 3b 0d 09 09 | to trac|k ");...|
|00001170| 09 50 75 74 53 44 65 63 | 28 63 75 72 72 65 6e 74 |.PutSDec|(current|
|00001180| 54 72 61 63 6b 29 3b 0d | 09 09 09 6f 73 45 72 72 |Track);.|...osErr|
|00001190| 20 3d 20 41 50 61 75 73 | 65 28 69 6f 52 65 66 4e | = APaus|e(ioRefN|
|000011a0| 75 6d 2c 20 61 75 64 69 | 6f 53 74 61 74 75 73 29 |um, audi|oStatus)|
|000011b0| 3b 0d 09 09 09 62 72 65 | 61 6b 3b 0d 09 09 09 0d |;....bre|ak;.....|
|000011c0| 09 09 63 61 73 65 20 27 | 3f 27 3a 0d 09 09 09 50 |..case '|?':....P|
|000011d0| 75 74 50 53 74 72 28 20 | 22 5c 70 54 72 61 63 6b |utPStr( |"\pTrack|
|000011e0| 20 22 29 3b 0d 09 09 09 | 50 75 74 53 44 65 63 28 | ");....|PutSDec(|
|000011f0| 63 75 72 72 65 6e 74 54 | 72 61 63 6b 29 3b 0d 09 |currentT|rack);..|
|00001200| 09 09 50 75 74 50 53 74 | 72 28 20 22 5c 70 20 20 |..PutPSt|r( "\p |
|00001210| 22 29 3b 0d 09 09 09 50 | 75 74 53 44 65 63 28 74 |");....P|utSDec(t|
|00001220| 72 61 63 6b 4d 69 6e 29 | 3b 0d 09 09 09 50 75 74 |rackMin)|;....Put|
|00001230| 50 53 74 72 28 20 22 5c | 70 3a 22 29 3b 0d 09 09 |PStr( "\|p:");...|
|00001240| 09 50 75 74 53 44 65 63 | 28 74 72 61 63 6b 53 65 |.PutSDec|(trackSe|
|00001250| 63 29 3b 0d 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |c);....b|reak;...|
|00001260| 09 0d 09 09 63 61 73 65 | 20 27 45 27 3a 0d 09 09 |....case| 'E':...|
|00001270| 63 61 73 65 20 27 65 27 | 3a 0d 09 09 09 50 75 74 |case 'e'|:....Put|
|00001280| 50 53 74 72 28 20 22 5c | 70 45 6a 65 63 74 69 6e |PStr( "\|pEjectin|
|00001290| 67 20 64 69 73 6b 22 29 | 3b 0d 09 09 09 6f 73 45 |g disk")|;....osE|
|000012a0| 72 72 20 3d 20 45 6a 65 | 63 74 43 44 28 69 6f 52 |rr = Eje|ctCD(ioR|
|000012b0| 65 66 4e 75 6d 29 3b 0d | 09 09 09 62 72 65 61 6b |efNum);.|...break|
|000012c0| 3b 09 0d 09 7d 0d 09 0d | 7d 0d 0d 0d 76 6f 69 64 |;...}...|}...void|
|000012d0| 09 50 6c 61 79 54 72 61 | 63 6b 28 42 79 74 65 20 |.PlayTra|ck(Byte |
|000012e0| 73 74 61 72 74 54 72 61 | 63 6b 29 20 0d 7b 0d 09 |startTra|ck) .{..|
|000012f0| 4f 53 45 72 72 09 6f 73 | 45 72 72 3b 0d 09 73 68 |OSErr.os|Err;..sh|
|00001300| 6f 72 74 09 64 72 69 76 | 65 2c 0d 09 09 09 69 6f |ort.driv|e,....io|
|00001310| 52 65 66 4e 75 6d 2c 0d | 09 09 09 63 6f 75 6e 74 |RefNum,.|...count|
|00001320| 2c 0d 09 09 09 74 72 61 | 63 6b 2c 0d 09 09 09 73 |,....tra|ck,....s|
|00001330| 74 61 74 65 3b 0d 09 42 | 79 74 65 09 75 73 65 72 |tate;..B|yte.user|
|00001340| 43 44 4e 75 6d 62 65 72 | 2c 0d 09 09 09 75 73 65 |CDNumber|,....use|
|00001350| 72 53 74 61 72 74 2c 20 | 0d 09 09 09 75 73 65 72 |rStart, |....user|
|00001360| 53 74 6f 70 2c 0d 09 09 | 09 64 69 73 63 53 74 61 |Stop,...|.discSta|
|00001370| 72 74 2c 0d 09 09 09 64 | 69 73 63 53 74 6f 70 2c |rt,....d|iscStop,|
|00001380| 0d 09 09 09 61 75 64 69 | 6f 53 74 61 74 75 73 2c |....audi|oStatus,|
|00001390| 0d 09 09 09 70 6c 61 79 | 4d 6f 64 65 2c 0d 09 09 |....play|Mode,...|
|000013a0| 09 63 6e 74 6c 46 69 65 | 6c 64 2c 0d 09 09 09 6d |.cntlFie|ld,....m|
|000013b0| 69 6e 75 74 65 73 2c 0d | 09 09 09 73 65 63 6f 6e |inutes,.|...secon|
|000013c0| 64 73 2c 0d 09 09 09 66 | 72 61 6d 65 73 3b 0d 09 |ds,....f|rames;..|
|000013d0| 75 73 65 72 43 44 4e 75 | 6d 62 65 72 09 3d 20 31 |userCDNu|mber.= 1|
|000013e0| 3b 0d 09 75 73 65 72 53 | 74 61 72 74 09 09 3d 20 |;..userS|tart..= |
|000013f0| 30 3b 0d 09 75 73 65 72 | 53 74 6f 70 09 09 3d 20 |0;..user|Stop..= |
|00001400| 31 30 30 3b 0d 09 70 6c | 61 79 4d 6f 64 65 09 09 |100;..pl|ayMode..|
|00001410| 3d 20 53 54 45 52 45 4f | 3b 0d 0d 09 6f 73 45 72 |= STEREO|;...osEr|
|00001420| 72 20 3d 20 4f 70 65 6e | 43 44 28 75 73 65 72 43 |r = Open|CD(userC|
|00001430| 44 4e 75 6d 62 65 72 2c | 20 26 69 6f 52 65 66 4e |DNumber,| &ioRefN|
|00001440| 75 6d 29 3b 0d 09 69 66 | 28 6f 73 45 72 72 20 21 |um);..if|(osErr !|
|00001450| 3d 20 6e 6f 45 72 72 29 | 20 7b 0d 09 09 50 75 74 |= noErr)| {...Put|
|00001460| 4c 69 6e 65 28 29 3b 0d | 09 09 50 75 74 50 53 74 |Line();.|..PutPSt|
|00001470| 72 28 20 22 5c 70 43 6f | 75 6c 64 6e 27 74 20 6f |r( "\pCo|uldn't o|
|00001480| 70 65 6e 20 43 44 20 44 | 72 69 76 65 21 22 29 3b |pen CD D|rive!");|
|00001490| 0d 09 09 72 65 74 75 72 | 6e 3b 0d 09 7d 0d 09 69 |...retur|n;..}..i|
|000014a0| 66 28 21 44 69 73 63 49 | 6e 44 72 69 76 65 28 69 |f(!DiscI|nDrive(i|
|000014b0| 6f 52 65 66 4e 75 6d 29 | 29 20 7b 0d 09 09 50 75 |oRefNum)|) {...Pu|
|000014c0| 74 4c 69 6e 65 28 29 3b | 0d 09 09 50 75 74 50 53 |tLine();|...PutPS|
|000014d0| 74 72 28 20 22 5c 70 4e | 6f 20 64 69 73 6b 20 69 |tr( "\pN|o disk i|
|000014e0| 6e 20 43 44 20 44 72 69 | 76 65 21 22 29 3b 0d 09 |n CD Dri|ve!");..|
|000014f0| 09 72 65 74 75 72 6e 3b | 0d 09 7d 0d 0d 09 6f 73 |.return;|..}...os|
|00001500| 45 72 72 20 3d 20 41 53 | 74 61 74 75 73 28 69 6f |Err = AS|tatus(io|
|00001510| 52 65 66 4e 75 6d 2c 20 | 26 61 75 64 69 6f 53 74 |RefNum, |&audioSt|
|00001520| 61 74 75 73 2c 20 26 70 | 6c 61 79 4d 6f 64 65 2c |atus, &p|layMode,|
|00001530| 20 26 63 6e 74 6c 46 69 | 65 6c 64 2c 20 26 6d 69 | &cntlFi|eld, &mi|
|00001540| 6e 75 74 65 73 2c 20 26 | 73 65 63 6f 6e 64 73 2c |nutes, &|seconds,|
|00001550| 20 26 66 72 61 6d 65 73 | 29 3b 0d 09 69 66 28 61 | &frames|);..if(a|
|00001560| 75 64 69 6f 53 74 61 74 | 75 73 20 3d 3d 20 50 41 |udioStat|us == PA|
|00001570| 55 53 45 44 29 20 7b 0d | 09 09 6f 73 45 72 72 20 |USED) {.|..osErr |
|00001580| 3d 20 41 50 61 75 73 65 | 28 69 6f 52 65 66 4e 75 |= APause|(ioRefNu|
|00001590| 6d 2c 20 43 4f 4e 54 49 | 4e 55 45 29 3b 0d 09 7d |m, CONTI|NUE);..}|
|000015a0| 20 65 6c 73 65 20 7b 0d | 09 0d 09 09 64 69 73 63 | else {.|....disc|
|000015b0| 53 74 61 72 74 20 3d 20 | 30 3b 20 0d 09 09 64 6f |Start = |0; ...do|
|000015c0| 20 0d 09 09 09 6f 73 45 | 72 72 20 3d 20 54 72 61 | ....osE|rr = Tra|
|000015d0| 63 6b 49 6e 66 6f 28 69 | 6f 52 65 66 4e 75 6d 2c |ckInfo(i|oRefNum,|
|000015e0| 20 2b 2b 64 69 73 63 53 | 74 61 72 74 2c 20 26 63 | ++discS|tart, &c|
|000015f0| 6e 74 6c 46 69 65 6c 64 | 2c 20 26 6d 69 6e 75 74 |ntlField|, &minut|
|00001600| 65 73 2c 20 26 73 65 63 | 6f 6e 64 73 2c 20 26 66 |es, &sec|onds, &f|
|00001610| 72 61 6d 65 73 29 3b 0d | 09 09 77 68 69 6c 65 20 |rames);.|..while |
|00001620| 28 42 69 74 54 73 74 28 | 26 63 6e 74 6c 46 69 65 |(BitTst(|&cntlFie|
|00001630| 6c 64 2c 20 35 29 20 26 | 26 20 6e 6f 45 72 72 20 |ld, 5) &|& noErr |
|00001640| 3d 3d 20 6f 73 45 72 72 | 29 3b 20 0d 09 09 6f 73 |== osErr|); ...os|
|00001650| 45 72 72 20 3d 20 54 72 | 61 63 6b 43 6f 75 6e 74 |Err = Tr|ackCount|
|00001660| 28 69 6f 52 65 66 4e 75 | 6d 2c 20 26 64 69 73 63 |(ioRefNu|m, &disc|
|00001670| 53 74 6f 70 29 3b 0d 0d | 09 09 69 66 20 28 6e 6f |Stop);..|..if (no|
|00001680| 45 72 72 20 3d 3d 20 6f | 73 45 72 72 29 20 7b 0d |Err == o|sErr) {.|
|00001690| 09 09 09 69 66 20 28 73 | 74 61 72 74 54 72 61 63 |...if (s|tartTrac|
|000016a0| 6b 20 3d 3d 20 30 29 20 | 20 7b 0d 09 09 09 09 6f |k == 0) | {.....o|
|000016b0| 73 45 72 72 20 3d 20 41 | 53 74 6f 70 28 69 6f 52 |sErr = A|Stop(ioR|
|000016c0| 65 66 4e 75 6d 2c 20 30 | 29 3b 0d 09 09 09 7d 0d |efNum, 0|);....}.|
|000016d0| 09 09 09 65 6c 73 65 20 | 7b 09 09 09 0d 09 09 09 |...else |{.......|
|000016e0| 09 6f 73 45 72 72 20 3d | 20 41 53 74 6f 70 28 69 |.osErr =| AStop(i|
|000016f0| 6f 52 65 66 4e 75 6d 2c | 20 6d 61 78 28 6d 69 6e |oRefNum,| max(min|
|00001700| 28 75 73 65 72 53 74 6f | 70 2c 20 64 69 73 63 53 |(userSto|p, discS|
|00001710| 74 6f 70 29 2c 20 64 69 | 73 63 53 74 61 72 74 29 |top), di|scStart)|
|00001720| 29 3b 0d 09 09 09 09 69 | 66 28 73 74 61 72 74 54 |);.....i|f(startT|
|00001730| 72 61 63 6b 20 3e 20 30 | 29 20 7b 0d 09 09 09 09 |rack > 0|) {.....|
|00001740| 09 75 73 65 72 53 74 61 | 72 74 20 3d 20 73 74 61 |.userSta|rt = sta|
|00001750| 72 74 54 72 61 63 6b 3b | 0d 09 09 09 09 09 6f 73 |rtTrack;|......os|
|00001760| 45 72 72 20 3d 20 41 50 | 6c 61 79 28 69 6f 52 65 |Err = AP|lay(ioRe|
|00001770| 66 4e 75 6d 2c 20 73 74 | 61 72 74 54 72 61 63 6b |fNum, st|artTrack|
|00001780| 2c 20 70 6c 61 79 4d 6f | 64 65 29 3b 0d 09 09 09 |, playMo|de);....|
|00001790| 09 7d 0d 09 09 09 09 65 | 6c 73 65 7b 0d 09 09 09 |.}.....e|lse{....|
|000017a0| 09 09 6f 73 45 72 72 20 | 3d 20 41 50 6c 61 79 28 |..osErr |= APlay(|
|000017b0| 69 6f 52 65 66 4e 75 6d | 2c 20 6d 69 6e 28 6d 61 |ioRefNum|, min(ma|
|000017c0| 78 28 75 73 65 72 53 74 | 61 72 74 2c 20 64 69 73 |x(userSt|art, dis|
|000017d0| 63 53 74 61 72 74 29 2c | 20 64 69 73 63 53 74 6f |cStart),| discSto|
|000017e0| 70 29 2c 20 70 6c 61 79 | 4d 6f 64 65 29 3b 0d 09 |p), play|Mode);..|
|000017f0| 09 09 09 7d 0d 09 09 09 | 7d 0d 09 09 7d 0d 09 7d |...}....|}...}..}|
|00001800| 0d 09 69 66 28 6f 73 45 | 72 72 29 20 7b 0d 09 09 |..if(osE|rr) {...|
|00001810| 50 75 74 50 53 74 72 28 | 20 22 5c 70 47 6f 74 20 |PutPStr(| "\pGot |
|00001820| 65 72 72 6f 72 20 74 72 | 79 69 6e 67 20 74 6f 20 |error tr|ying to |
|00001830| 70 6c 61 79 20 22 29 3b | 0d 09 09 50 75 74 53 44 |play ");|...PutSD|
|00001840| 65 63 28 6f 73 45 72 72 | 29 3b 0d 09 7d 0d 7d 0d |ec(osErr|);..}.}.|
|00001850| 0d 2f 2f 0d 2f 2a 0d 70 | 61 73 63 61 6c 20 42 6f |.//./*.p|ascal Bo|
|00001860| 6f 6c 65 61 6e 09 42 69 | 74 54 65 73 74 28 63 6f |olean.Bi|tTest(co|
|00001870| 6e 73 74 20 76 6f 69 64 | 20 2a 09 64 61 74 61 2c |nst void| *.data,|
|00001880| 20 6c 6f 6e 67 20 62 69 | 74 4e 75 6d 29 0d 7b 0d | long bi|tNum).{.|
|00001890| 09 75 6e 73 69 67 6e 65 | 64 20 6c 6f 6e 67 20 6d |.unsigne|d long m|
|000018a0| 61 73 6b 3b 0d 09 75 6e | 73 69 67 6e 65 64 20 6c |ask;..un|signed l|
|000018b0| 6f 6e 67 09 76 61 6c 75 | 65 3b 0d 09 0d 09 69 66 |ong.valu|e;....if|
|000018c0| 28 62 69 74 4e 75 6d 20 | 3e 20 33 31 29 20 72 65 |(bitNum |> 31) re|
|000018d0| 74 75 72 6e 20 66 61 6c | 73 65 3b 0d 09 0d 09 62 |turn fal|se;....b|
|000018e0| 69 74 4e 75 6d 20 3d 20 | 33 31 20 2d 20 62 69 74 |itNum = |31 - bit|
|000018f0| 4e 75 6d 3b 0d 09 0d 09 | 76 61 6c 75 65 20 3d 20 |Num;....|value = |
|00001900| 2a 28 28 75 6e 73 69 67 | 6e 65 64 20 6c 6f 6e 67 |*((unsig|ned long|
|00001910| 20 2a 29 64 61 74 61 29 | 3b 0d 09 6d 61 73 6b 20 | *)data)|;..mask |
|00001920| 3d 20 31 20 3c 3c 20 62 | 69 74 4e 75 6d 3b 0d 09 |= 1 << b|itNum;..|
|00001930| 72 65 74 75 72 6e 20 28 | 28 76 61 6c 75 65 20 26 |return (|(value &|
|00001940| 20 6d 61 73 6b 29 20 21 | 3d 20 30 29 3b 0d 7d 0d | mask) !|= 0);.}.|
|00001950| 2a 2f 0d 0d 70 61 73 63 | 61 6c 20 76 6f 69 64 20 |*/..pasc|al void |
|00001960| 43 6f 6d 6d 61 6e 64 45 | 6e 74 72 79 28 20 64 63 |CommandE|ntry( dc|
|00001970| 6d 64 42 6c 6f 63 6b 2a | 20 70 61 72 61 6d 50 74 |mdBlock*| paramPt|
|00001980| 72 20 29 0d 7b 0d 09 52 | 65 6d 65 6d 62 65 72 41 |r ).{..R|ememberA|
|00001990| 30 28 29 3b 0d 09 53 65 | 74 55 70 41 34 28 29 3b |0();..Se|tUpA4();|
|000019a0| 09 0d 09 0d 09 73 77 69 | 74 63 68 20 28 20 70 61 |.....swi|tch ( pa|
|000019b0| 72 61 6d 50 74 72 2d 3e | 72 65 71 75 65 73 74 20 |ramPtr->|request |
|000019c0| 29 0d 09 7b 0d 09 09 63 | 61 73 65 20 64 63 6d 64 |)..{...c|ase dcmd|
|000019d0| 49 6e 69 74 20 3a 20 62 | 72 65 61 6b 3b 0d 09 09 |Init : b|reak;...|
|000019e0| 0d 09 09 63 61 73 65 20 | 64 63 6d 64 48 65 6c 70 |...case |dcmdHelp|
|000019f0| 20 3a 20 44 6f 48 65 6c | 70 28 29 3b 0d 09 09 09 | : DoHel|p();....|
|00001a00| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 09 09 09 09 |...break|;.......|
|00001a10| 0d 09 09 63 61 73 65 20 | 64 63 6d 64 44 6f 49 74 |...case |dcmdDoIt|
|00001a20| 20 3a 20 44 6f 4a 6f 62 | 28 29 3b 0d 09 09 09 09 | : DoJob|();.....|
|00001a30| 09 09 62 72 65 61 6b 3b | 0d 09 7d 0d 0d 09 52 65 |..break;|..}...Re|
|00001a40| 73 74 6f 72 65 41 34 28 | 29 3b 0d 7d 00 00 00 00 |storeA4(|);.}....|
|00001a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a80| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00001a90| 00 00 16 78 14 4d 6f 76 | 65 20 2e 72 20 66 69 6c |...x.Mov|e .r fil|
|00001aa0| 65 73 20 74 6f 20 65 6e | 64 72 02 00 00 00 6f 73 |es to en|dr....os|
|00001ab0| 06 64 63 6d 64 2e 63 64 | 02 00 00 00 00 00 00 00 |.dcmd.cd|........|
|00001ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 56 1a |........|......V.|
|00001ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001af0| 00 00 ad f0 e3 1f 00 00 | 19 cc 00 00 01 9a 00 00 |........|........|
|00001b00| 80 53 00 01 00 00 00 00 | 00 00 00 00 00 00 00 00 |.S......|........|
|00001b10| 12 00 00 00 16 78 0c 50 | 72 6f 6a 65 63 74 20 49 |.....x.P|roject I|
|00001b20| 6e 66 6f 78 02 00 02 00 | 6f 73 61 73 54 6f 79 53 |nfox....|osasToyS|
|00001b30| 01 00 00 00 00 80 00 00 | 00 00 16 7c 00 00 00 00 |........|...|....|
|00001b40| 00 00 00 00 00 00 00 00 | 00 00 0b d2 00 00 10 00 |........|........|
|00001b50| a9 b5 0c 38 a9 b5 0c 38 | 00 00 00 00 00 00 00 00 |...8...8|........|
|00001b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b70| 00 00 00 00 00 00 00 00 | 00 00 80 54 00 01 00 00 |........|...T....|
|00001b80| 00 00 00 04 00 01 00 01 | 00 00 00 48 00 09 4d 6f |........|...H..Mo|
|00001b90| 6e 61 63 6f 00 00 00 00 | 00 00 00 00 00 00 00 00 |naco....|........|
|00001ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 06 |........|........|
|00001bb0| 00 04 00 2a 00 03 02 fd | 03 fd 00 3b 00 f5 02 90 |...*....|...;....|
|00001bc0| 03 91 ac 21 88 ca 00 00 | 14 49 00 00 14 49 00 00 |...!....|.I...I..|
|00001bd0| 00 00 00 00 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|00001be0| 00 00 00 46 01 df e2 ec | 1c a6 00 00 00 1c 00 46 |...F....|.......F|
|00001bf0| 00 01 4d 57 42 42 00 00 | 00 12 4d 50 53 52 00 00 |..MWBB..|..MPSR..|
|00001c00| 00 1e 03 f0 ff ff 00 00 | 00 00 00 00 00 00 03 ed |........|........|
|00001c10| ff ff 00 00 00 08 01 df | e0 98 00 00 00 00 00 00 |........|........|
|00001c20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+